home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1994 June / PC Plus Super CD coverdisc Issue 93 June 1994.iso / suprdisk / button / frmsaveb.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-04-02  |  4.6 KB  |  155 lines

  1. VERSION 2.00
  2. Begin Form frmSaveBit 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "Initialize new bitmap"
  5.    ClientHeight    =   4455
  6.    ClientLeft      =   4005
  7.    ClientTop       =   1620
  8.    ClientWidth     =   3915
  9.    ClipControls    =   0   'False
  10.    ControlBox      =   0   'False
  11.    Height          =   4860
  12.    Left            =   3945
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   4455
  17.    ScaleWidth      =   3915
  18.    Top             =   1275
  19.    Width           =   4035
  20.    Begin TextBox tbxBorder 
  21.       Height          =   285
  22.       Left            =   675
  23.       MaxLength       =   1
  24.       TabIndex        =   3
  25.       Text            =   "2"
  26.       Top             =   2250
  27.       Width           =   390
  28.    End
  29.    Begin CheckBox chkSave 
  30.       Caption         =   "Button OFF"
  31.       Height          =   330
  32.       Index           =   2
  33.       Left            =   1050
  34.       TabIndex        =   2
  35.       Top             =   990
  36.       Width           =   1365
  37.    End
  38.    Begin CheckBox chkSave 
  39.       Caption         =   "Button DOWN"
  40.       Height          =   330
  41.       Index           =   1
  42.       Left            =   1050
  43.       TabIndex        =   1
  44.       Top             =   585
  45.       Width           =   1590
  46.    End
  47.    Begin CheckBox chkSave 
  48.       Caption         =   "Button UP"
  49.       Height          =   330
  50.       Index           =   0
  51.       Left            =   1050
  52.       TabIndex        =   0
  53.       Top             =   135
  54.       Width           =   1290
  55.    End
  56.    Begin CommandButton cmdCancel 
  57.       Cancel          =   -1  'True
  58.       Caption         =   "Cancel"
  59.       Height          =   375
  60.       Left            =   2175
  61.       TabIndex        =   5
  62.       Top             =   3825
  63.       Width           =   1000
  64.    End
  65.    Begin CommandButton cmdOK 
  66.       Caption         =   "OK"
  67.       Default         =   -1  'True
  68.       Height          =   375
  69.       Left            =   600
  70.       TabIndex        =   4
  71.       Top             =   3825
  72.       Width           =   1000
  73.    End
  74.    Begin Label Label3 
  75.       Caption         =   "Thickness of the border around each button. Max 9"
  76.       Height          =   465
  77.       Left            =   1200
  78.       TabIndex        =   8
  79.       Top             =   2160
  80.       Width           =   2340
  81.    End
  82.    Begin Line Line1 
  83.       BorderColor     =   &H00008000&
  84.       X1              =   600
  85.       X2              =   3150
  86.       Y1              =   2700
  87.       Y2              =   2700
  88.    End
  89.    Begin Label Label2 
  90.       Caption         =   "This selection will stay in force until you resize the drawing area, when the bitmap will be reinitialized"
  91.       Height          =   870
  92.       Left            =   600
  93.       TabIndex        =   7
  94.       Top             =   2790
  95.       Width           =   2790
  96.    End
  97.    Begin Label Label1 
  98.       Caption         =   "Check the buttons you wish to save to the master bitmap."
  99.       Height          =   465
  100.       Left            =   600
  101.       TabIndex        =   6
  102.       Top             =   1620
  103.       Width           =   2640
  104.    End
  105. Option Explicit
  106. Sub cmdCancel_Click ()
  107.     Unload frmSaveBit
  108. End Sub
  109. Sub cmdOK_Click ()
  110.     Dim n As Integer
  111.     Dim Count As Integer
  112.     Dim NumButtons As Integer
  113.     Dim FrameWidth As Integer
  114.     'Width of the border that surrounds the picturebox
  115.     FrameWidth = GetSystemMetrics(SM_CXBORDER) * 2
  116.     'Put which buttons need to be saved into Count
  117.     ''Up' = 1, Down = 2, Disabled = 4
  118.     For n = 0 To 2
  119.         If chkSave(n) > 0 Then
  120.             Count = Count + (2 ^ n)
  121.             NumButtons = NumButtons + 1
  122.         End If
  123.     Next n
  124.     'If the border width for the boxes is illegal then retry
  125.     If IsNumeric(tbxBorder) Then
  126.         BitMap.Border = tbxBorder
  127.     Else
  128.         MsgBox "Please enter the border width"
  129.         tbxBorder.SetFocus
  130.         Exit Sub
  131.     End If
  132.     If NumButtons < 1 Then
  133.         MsgBox "Nothing Selected"
  134.         Exit Sub
  135.     End If
  136.     'Put the buttons to be saved into BitMap.Buttons
  137.     BitMap.Buttons = Count
  138.     frmBitMap!picBitMap.Width = (BitMap.ButtonWidth + (BitMap.Border * 2)) * NumButtons + FrameWidth
  139.     Unload frmSaveBit
  140. End Sub
  141. Sub Form_Activate ()
  142.     HelpItem = 24
  143. End Sub
  144. Sub Form_KeyDown (KeyCode As Integer, Shift As Integer)
  145.     If KeyCode = &H70 Then Cheap_Help Format$(HelpItem)
  146. End Sub
  147. Sub Form_Load ()
  148.     Position_Form frmSaveBit
  149.     KeyPreview = True
  150. End Sub
  151. Sub tbxBorder_GotFocus ()
  152.     tbxBorder.SelStart = 0
  153.     tbxBorder.SelLength = Len(tbxBorder)
  154. End Sub
  155.